import axios from '@/axios'

// 商品分类列表
export const getCategoryListAPI = () => {
  return axios.get('admin/category')
}
// /增加商品分类
export const createCategoryAPI = (data) => {
  return axios.post('admin/category', data)
}

export const updateCategoryAPI = (id, data) => {
  return axios.post(`admin/category/${id}`, data)
}

export const updateCategoryStatusAPI = (id, status) => {
  return axios.post(`admin/category/${id}/update_status`, { status })
}

export const deleteCategoryAPI = (id) => {
  return axios.post(`admin/category/${id}/delete`)
}

export const getCategoryGoodsAPI = (id) => {
  return axios.get(`/admin/app_category_item/list?category_id=${id}`)
}
export const deleteCategoryGoodsAPI = (id) => {
  return axios.post(`/admin/app_category_item/${id}/delete`)
}
export const connectCategoryGoodsAPI = (data) => {
  return axios.post(`/admin/app_category_item`, data)
}
